<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * @fileOverview This file with Sonettic-Cinema HD Player 5 Simple JavaScript API
<span class='line'>  3</span>  * @alias SimpleAPI
<span class='line'>  4</span>  * @author Max Klymyshyn, (c)2009 Sonettic, sonettic-cinema.com, sonettic.com
<span class='line'>  5</span>  * @version 1.0
<span class='line'>  6</span>  */</span><span class="WHIT">
<span class='line'>  7</span> </span><span class="WHIT"> 
<span class='line'>  8</span>  
<span class='line'>  9</span> </span><span class="COMM">/**
<span class='line'> 10</span>  * @func
<span class='line'> 11</span>  * @description method to geting Flash object. Only for internal use.
<span class='line'> 12</span>  * @private
<span class='line'> 13</span>  * @param name player name
<span class='line'> 14</span>  * @return Flash object
<span class='line'> 15</span>  */</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">__getSCPlayer</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">isIE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">navigator.appName.indexOf</span><span class="PUNC">(</span><span class="STRN">"Microsoft"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT">	</span><span class="KEYW">try</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT">		</span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">isIE</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">window</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">document</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT">		</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"Cannot find player ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]. Details: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e.message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 24</span> 
<span class='line'> 25</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 27</span> 
<span class='line'> 28</span> 
<span class='line'> 29</span> </span><span class="COMM">/**
<span class='line'> 30</span>  * @func
<span class='line'> 31</span>  * @description This is static function to set new video source to the player with name playerName. Usage example:
<span class='line'> 32</span>  * @example
<span class='line'> 33</span> 	&lt;pre style='color:#000000;background:#ffffff;'>
<span class='line'> 34</span> &lt;span style='color:#696969; '>// http stream and path from the root of your domain&lt;/span>
<span class='line'> 35</span> setContent&lt;span style='color:#808030; '>(&lt;/span>&lt;span style='color:#0000e6; '>'sonetticFLVPlayer'&lt;/span>&lt;span style='color:#808030; '>,&lt;/span>&lt;span style='color:#0000e6; '>'[filename]?start=[seek],/video/Walle1.flv'&lt;/span>&lt;span style='color:#808030; '>)&lt;/span>&lt;span style='color:#800080; '>;&lt;/span>
<span class='line'> 36</span> 
<span class='line'> 37</span> &lt;span style='color:#696969; '>// http stream with full path of the video&lt;/span>
<span class='line'> 38</span> setContent&lt;span style='color:#808030; '>(&lt;/span>&lt;span style='color:#0000e6; '>'sonetticFLVPlayer'&lt;/span>&lt;span style='color:#808030; '>,&lt;/span>&lt;span style='color:#0000e6; '>'[filename]?start=[seek],http://myhost.com/flv/Walle1.flv'&lt;/span>&lt;span style='color:#808030; '>)&lt;/span>&lt;span style='color:#800080; '>;&lt;/span>
<span class='line'> 39</span> 
<span class='line'> 40</span> &lt;span style='color:#696969; '>// progressive download and path from the root of your domain&lt;/span>
<span class='line'> 41</span> setContent&lt;span style='color:#808030; '>(&lt;/span>&lt;span style='color:#0000e6; '>'sonetticFLVPlayer'&lt;/span>&lt;span style='color:#808030; '>,&lt;/span>&lt;span style='color:#0000e6; '>'/video/Walle1.flv'&lt;/span>&lt;span style='color:#808030; '>)&lt;/span>&lt;span style='color:#800080; '>;&lt;/span>
<span class='line'> 42</span> 	&lt;/pre>
<span class='line'> 43</span>  * @param playerName name of the player
<span class='line'> 44</span>  * @param videoPath path to the video, RTMP or HTTP Stream
<span class='line'> 45</span>  * @return void
<span class='line'> 46</span>  */</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">setContent</span><span class="PUNC">(</span><span class="NAME">playerName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">videoPath</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT">	</span><span class="KEYW">try</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT">		</span><span class="NAME">__getSCPlayer</span><span class="PUNC">(</span><span class="NAME">playerName</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">setContent</span><span class="PUNC">(</span><span class="NAME">videoPath</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT">		</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"setContent(...):Can't change player's content to ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">videoPath</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]. Details: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e.message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 54</span> 
<span class='line'> 55</span> </span><span class="COMM">/**
<span class='line'> 56</span>  * @func
<span class='line'> 57</span>  * @deprecated This function used before ver.5 of &lt;a href="http://sonettic-cinema.com/products/players/">&lt;strong>Sonettic-Cinema HD Player&lt;/strong>&lt;/a>.
<span class='line'> 58</span>  * @description This is static function is an alias to setContent and using only for backward compatibility. Use {@link setContent}
<span class='line'> 59</span>  * @param playerName name of the player
<span class='line'> 60</span>  * @param videoPath path to the video, RTMP or HTTP Stream
<span class='line'> 61</span>  * @return void
<span class='line'> 62</span>  */</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">setMedia</span><span class="PUNC">(</span><span class="NAME">playerName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">videoPath</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT">	</span><span class="NAME">setContent</span><span class="PUNC">(</span><span class="NAME">playerName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">videoPath</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 66</span> 
<span class='line'> 67</span> </span><span class="COMM">/** 
<span class='line'> 68</span>  * @func
<span class='line'> 69</span>  * @description This is static function to set position within current video in player &lt;strong>playerName&lt;/strong>. It's pretty simple to use it, for example:
<span class='line'> 70</span>  * @example
<span class='line'> 71</span>  	&lt;pre style='color:#000000;background:#ffffff;'>
<span class='line'> 72</span>  	&lt;span style='color:#696969; '>// set position to 60 seconds from start&lt;/span>
<span class='line'> 73</span> 	setPosition&lt;span style='color:#808030; '>(&lt;/span>&lt;span style='color:#0000e6; '>'sonetticFLVPlayer'&lt;/span>&lt;span style='color:#808030; '>,&lt;/span>&lt;span style='color:#0000e6; '>60&lt;/span>&lt;span style='color:#808030; '>)&lt;/span>&lt;span style='color:#800080; '>;&lt;/span>
<span class='line'> 74</span> 	
<span class='line'> 75</span> 	&lt;span style='color:#696969; '>// set position to 100 seconds from start&lt;/span>
<span class='line'> 76</span> 	setPosition&lt;span style='color:#808030; '>(&lt;/span>&lt;span style='color:#0000e6; '>'sonetticFLVPlayer'&lt;/span>&lt;span style='color:#808030; '>,&lt;/span>&lt;span style='color:#0000e6; '>100&lt;/span>&lt;span style='color:#808030; '>)&lt;/span>&lt;span style='color:#800080; '>;&lt;/span>
<span class='line'> 77</span> 	&lt;/pre>
<span class='line'> 78</span>  * @param playerName name of the player
<span class='line'> 79</span>  * @param {int} positiontime New position of the current movie in seconds
<span class='line'> 80</span>  * @return void
<span class='line'> 81</span>  */</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">setPosition</span><span class="PUNC">(</span><span class="NAME">playerName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">positiontime</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT">	</span><span class="KEYW">try</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT">		</span><span class="NAME">__getSCPlayer</span><span class="PUNC">(</span><span class="NAME">playerName</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">setPosition</span><span class="PUNC">(</span><span class="NAME">positiontime</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT">		</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"setPosition(...): Can't change video position to "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">positiontime</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" because "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e.message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 89</span> 
<span class='line'> 90</span> 
<span class='line'> 91</span> </span><span class="COMM">/**
<span class='line'> 92</span>  * @func
<span class='line'> 93</span>  * @description This is static function to stop playing of the current video in player &lt;strong>playerName&lt;/strong>.
<span class='line'> 94</span>  * @example
<span class='line'> 95</span> 	&lt;pre style='color:#000000;background:#ffffff;'>
<span class='line'> 96</span> 	&lt;span style='color:#696969; '>// stop playing of video in player sonetticFLVPlayer&lt;/span>
<span class='line'> 97</span> 	stopMedia&lt;span style='color:#808030; '>(&lt;/span>&lt;span style='color:#0000e6; '>'sonetticFLVPlayer'&lt;/span>&lt;span style='color:#808030; '>)&lt;/span>&lt;span style='color:#800080; '>;&lt;/span>
<span class='line'> 98</span> 	&lt;/pre>
<span class='line'> 99</span>  * @param playerName name of the player
<span class='line'>100</span>  * @return void
<span class='line'>101</span>  */</span><span class="WHIT"> 
<span class='line'>102</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">stopMedia</span><span class="PUNC">(</span><span class="NAME">playerName</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT">	</span><span class="KEYW">try</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT">		</span><span class="NAME">__getSCPlayer</span><span class="PUNC">(</span><span class="NAME">playerName</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">stopMedia</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">	
<span class='line'>105</span> 	</span><span class="PUNC">}</span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT">		</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"stopMedia(...): Can't stop media because "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e.message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>108</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>109</span> 
<span class='line'>110</span> </span><span class="COMM">/**
<span class='line'>111</span>  * @func
<span class='line'>112</span>  * @description This is static function to pause current video in player &lt;strong>playerName&lt;/strong>.
<span class='line'>113</span>  * @example
<span class='line'>114</span> 	&lt;pre style='color:#000000;background:#ffffff;'>
<span class='line'>115</span> 	&lt;span style='color:#696969; '>// pause playing of video in player sonetticFLVPlayer&lt;/span>
<span class='line'>116</span> 	pauseMedia&lt;span style='color:#808030; '>(&lt;/span>&lt;span style='color:#0000e6; '>'sonetticFLVPlayer'&lt;/span>&lt;span style='color:#808030; '>)&lt;/span>&lt;span style='color:#800080; '>;&lt;/span>
<span class='line'>117</span> 	&lt;/pre> 
<span class='line'>118</span>  * @param playerName name of the player
<span class='line'>119</span>  * @return void
<span class='line'>120</span>  */</span><span class="WHIT">
<span class='line'>121</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">pauseMedia</span><span class="PUNC">(</span><span class="NAME">playerName</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT">	</span><span class="KEYW">try</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>123</span> </span><span class="WHIT">		</span><span class="NAME">__getSCPlayer</span><span class="PUNC">(</span><span class="NAME">playerName</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">pauseMedia</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>124</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT">		</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"pauseMedia(...): Can't pause media because "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e.message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>127</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>128</span> 
<span class='line'>129</span> </span><span class="COMM">/**
<span class='line'>130</span>  * @func 
<span class='line'>131</span>  * @description This is static function to play current video in player &lt;strong>playerName&lt;/strong>.
<span class='line'>132</span>  * @example
<span class='line'>133</span> 	&lt;pre style='color:#000000;background:#ffffff;'>
<span class='line'>134</span> 	&lt;span style='color:#696969; '>// lets play media&lt;/span>
<span class='line'>135</span> 	playMedia&lt;span style='color:#808030; '>(&lt;/span>&lt;span style='color:#0000e6; '>'sonetticFLVPlayer'&lt;/span>&lt;span style='color:#808030; '>)&lt;/span>&lt;span style='color:#800080; '>;&lt;/span>
<span class='line'>136</span> 	&lt;/pre> 
<span class='line'>137</span>  * @param playerName name of the player
<span class='line'>138</span>  * @return void
<span class='line'>139</span>  */</span><span class="WHIT">
<span class='line'>140</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">playMedia</span><span class="PUNC">(</span><span class="NAME">playerName</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT">	</span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>142</span> </span><span class="WHIT">		</span><span class="NAME">__getSCPlayer</span><span class="PUNC">(</span><span class="NAME">playerName</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">playMedia</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">	
<span class='line'>143</span> 	</span><span class="PUNC">}</span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>144</span> </span><span class="WHIT">		</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"playMedia(...): Can't play media because "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e.message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>146</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>147</span> 
<span class='line'>148</span> </span></pre></body></html>